<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        配件报价
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../../css/main.css" media="all">
    <script type="text/javascript" src="../../../../lib/loading/okLoading.js"></script>
    <link rel="stylesheet" href="../../../../css/bootstrap.css">
    <link rel="stylesheet" href="../../../../lib/layui/css/layui_2.5.7.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
</head>

<body>
<div>
    <div id="app">

        <div class="main_box">
            <div class="panel-heading">
                <ul class="nav nav-tabs" id="navTabs">
                    <li class=""><a class="receivePane" data-tab=""
                                    :href="'supplier_base_info.html?recordId=' + recordId">基本信息</a>
                    </li>
                    <li class="active"><a class="payPane" data-tab=""
                                          :href="'supplier_parts_price.html?recordId=' + recordId">配件报价</a></li>
                    <li class=""><a class="payPane" data-tab=""
                                    :href="'supplier_purchasing_information.html?recordId=' + recordId">采购信息</a></li>
                </ul>
            </div>
        </div>


        <div class="layui-card-body">
            <form class="layui-form x-center">
                <div class="layui-form-pane" style="margin-top: 15px;">
                    <div class="layui-form-item" style="padding-left: 7%">
                        <label class="layui-form-label">配件信息</label>
                        <div class="layui-input-inline">
                            <input  autocomplete="off"  type="text" class="layui-input" name="partsMessage" placeholder="配件信息">
                        </div>
                        <label class="layui-form-label">关联物料</label>
                        <div class="layui-input-inline">
                            <input  autocomplete="off"  type="text" class="layui-input" name="partsNum"
                                   placeholder="关联物料">
                        </div>
                        <div style="clear: both"></div>
                        <label class="layui-form-label">供应商料号</label>
                        <div style="width: 68%" class="layui-input-inline">
                            <input  autocomplete="off"  type="text" class="layui-input" name="supplierNum" placeholder="供应商料号">
                        </div>
                        <div style="clear: both"></div>
                        <label class="layui-form-label">配件报价</label>
                        <div style="width: 22%" class="layui-input-inline">
                            <input  autocomplete="off"  type="text" class="layui-input" name="smallValue" placeholder="最小值">
                        </div>
                        <label class="layui-form-label">~</label>
                        <div style="width: 23%" class="layui-input-inline">
                            <input  autocomplete="off"  type="text" class="layui-input" name="bigValue" placeholder="最大值">
                        </div>
                        <!--<label class="layui-form-label">票据类型</label>-->
                        <!--<div class="layui-input-inline">-->
                        <!--<select name="billType" lay-search="">-->
                        <!--<option value="">-&#45;&#45;</option>-->
                        <!--</select>-->
                        <!--</div>-->

                        <div style="width: auto" class="layui-input-inline layui-show-xs-block">
                            <button class="layui-btn" type="button" lay-filter="sreach" data-type="reload"
                                    onclick="reload()">
                                <i class="layui-icon">&#xe615;</i></button>
                        </div>

                    </div>
                </div>
            </form>


            <div class="layui-card-body">
                <table class="layui-table" id="test" lay-filter="test">
                </table>
            </div>
        </div>
        <br><br><br><br><br><br>
    </div>

</div>
</body>


<script type="text/javascript" src="../../../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../../../js/myAjax.js"></script>
<script type="text/javascript" src="../../../../js/pub.js"></script>
<script type="text/javascript" src="../../../../lib/layui/layui2.5.7.js"></script>
<script type="text/javascript" src="../../../../js/vue.min.js"></script>
<!-- <script src="lib/layui/layui.js" charset="utf-8"></script> -->
<script src="../../../../js/x-layui.js" charset="utf-8"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script>
    layui.use(['laydate', 'element', 'laypage', 'layer', 'form'], function () {
        $ = layui.jquery;//jquery
        laydate = layui.laydate;//日期插件
        lement = layui.element;//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
        okLoading.close($);
    });
</script>

<script>

    let recordId = getQueryVariable("recordId");
    new Vue({
        el: "#app",
        data: {
            recordId,
        },

    });


    layui.use('table', function () {
        table = layui.table;
        var t1 = table.render({
            elem: '#test',
            url: $baseUrl + 'kf/supplier/getPartsOffer',
            where: {
                userId: $userId,
                supplierId: recordId
            },
            headers: {
                token: $token,

            }
            , toolbar: '#toolbarDemo',

            cols: [
                [
                    {
                        field: 'partsName',
                        title: '配件名称',
                    },
                    {
                        field: 'specification',
                        title: '配件规格',
                    },
                    {
                        field: 'partsNum',
                        title: '关联物料',
                    },
                    {
                        field: 'supplierNum',
                        title: '供应商料号',
                    },
                    {
                        field: 'partsOffer',
                        title: '配件报价',
                    },
                    {
                        field: 'offerRemark',
                        title: '备注',
                        width: '15%'
                    }]
            ],
            request: {
                pageName: 'page', //页码的参数名称，默认：page
                limitName: 'size',
            },
            response: {
                statusName: 'code' //规定数据状态的字段名称，默认：code
                ,
                statusCode: 0 //规定成功的状态码，默认：0
                ,
                msgName: 'msg' //规定状态信息的字段名称，默认：msg
                ,
                countName: 'total' //规定数据总数的字段名称，默认：count
                ,
                dataName: 'data.PartsOfferData', //规定数据列表的字段名称，默认：data
            },
            id: 'test',
            page: true,
            height: 'auto',
            even: true,
            done: function (res, curr, count) {
                //是否有权限或权限是否失效
                // authorizeState();
            }
        });

    });

    function reload(value) {
        table.reload('test', {
            where: {
                partsMessage: $("input[name=partsMessage]").val(),
                partsNum: $("input[name=partsNum]").val(),
                supplierNum: $("input[name=supplierNum]").val(),
                smallValue: $("input[name=smallValue]").val(),
                bigValue: $("input[name=bigValue]").val(),
            }
        });
    }


</script>


</html>
